from selenium import webdriver
import unittest
import time
import unittest
from selenium import webdriver
from selenium.common.exceptions import NoAlertPresentException
class testCase1(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.url="https://www.baidu.com/"
        self.driver.get(self.url)
        self.driver.maximize_window()
        time.sleep(3)

    def tearDown(self):
        self.driver.quit()

    def test_baidu1(self):
        driver=self.driver
        driver.find_element_by_id("kw").send_keys("李易峰")
        driver.find_element_by_id("su").click()
        time.sleep(3)
        self.assertEqual(driver.title,"李易峰_百度搜索")

    if __name__ == "__main__":
        unittest.main(verbosity=0)

